package com.mobile.check.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.mobile.check.beans.TaskItemInfo;
import com.mobile.check.beans.TaskInfo;
import com.mobile.check.beans.CheckItemGroupInfo;
import com.mobile.check.beans.TaskZipInfo;
import com.mobile.check.beans.CheckFileInfo;
import com.mobile.check.beans.CheckItemInfo;

import com.mobile.check.db.TaskItemInfoDao;
import com.mobile.check.db.TaskInfoDao;
import com.mobile.check.db.CheckItemGroupInfoDao;
import com.mobile.check.db.TaskZipInfoDao;
import com.mobile.check.db.CheckFileInfoDao;
import com.mobile.check.db.CheckItemInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig taskItemInfoDaoConfig;
    private final DaoConfig taskInfoDaoConfig;
    private final DaoConfig checkItemGroupInfoDaoConfig;
    private final DaoConfig taskZipInfoDaoConfig;
    private final DaoConfig checkFileInfoDaoConfig;
    private final DaoConfig checkItemInfoDaoConfig;

    private final TaskItemInfoDao taskItemInfoDao;
    private final TaskInfoDao taskInfoDao;
    private final CheckItemGroupInfoDao checkItemGroupInfoDao;
    private final TaskZipInfoDao taskZipInfoDao;
    private final CheckFileInfoDao checkFileInfoDao;
    private final CheckItemInfoDao checkItemInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        taskItemInfoDaoConfig = daoConfigMap.get(TaskItemInfoDao.class).clone();
        taskItemInfoDaoConfig.initIdentityScope(type);

        taskInfoDaoConfig = daoConfigMap.get(TaskInfoDao.class).clone();
        taskInfoDaoConfig.initIdentityScope(type);

        checkItemGroupInfoDaoConfig = daoConfigMap.get(CheckItemGroupInfoDao.class).clone();
        checkItemGroupInfoDaoConfig.initIdentityScope(type);

        taskZipInfoDaoConfig = daoConfigMap.get(TaskZipInfoDao.class).clone();
        taskZipInfoDaoConfig.initIdentityScope(type);

        checkFileInfoDaoConfig = daoConfigMap.get(CheckFileInfoDao.class).clone();
        checkFileInfoDaoConfig.initIdentityScope(type);

        checkItemInfoDaoConfig = daoConfigMap.get(CheckItemInfoDao.class).clone();
        checkItemInfoDaoConfig.initIdentityScope(type);

        taskItemInfoDao = new TaskItemInfoDao(taskItemInfoDaoConfig, this);
        taskInfoDao = new TaskInfoDao(taskInfoDaoConfig, this);
        checkItemGroupInfoDao = new CheckItemGroupInfoDao(checkItemGroupInfoDaoConfig, this);
        taskZipInfoDao = new TaskZipInfoDao(taskZipInfoDaoConfig, this);
        checkFileInfoDao = new CheckFileInfoDao(checkFileInfoDaoConfig, this);
        checkItemInfoDao = new CheckItemInfoDao(checkItemInfoDaoConfig, this);

        registerDao(TaskItemInfo.class, taskItemInfoDao);
        registerDao(TaskInfo.class, taskInfoDao);
        registerDao(CheckItemGroupInfo.class, checkItemGroupInfoDao);
        registerDao(TaskZipInfo.class, taskZipInfoDao);
        registerDao(CheckFileInfo.class, checkFileInfoDao);
        registerDao(CheckItemInfo.class, checkItemInfoDao);
    }
    
    public void clear() {
        taskItemInfoDaoConfig.clearIdentityScope();
        taskInfoDaoConfig.clearIdentityScope();
        checkItemGroupInfoDaoConfig.clearIdentityScope();
        taskZipInfoDaoConfig.clearIdentityScope();
        checkFileInfoDaoConfig.clearIdentityScope();
        checkItemInfoDaoConfig.clearIdentityScope();
    }

    public TaskItemInfoDao getTaskItemInfoDao() {
        return taskItemInfoDao;
    }

    public TaskInfoDao getTaskInfoDao() {
        return taskInfoDao;
    }

    public CheckItemGroupInfoDao getCheckItemGroupInfoDao() {
        return checkItemGroupInfoDao;
    }

    public TaskZipInfoDao getTaskZipInfoDao() {
        return taskZipInfoDao;
    }

    public CheckFileInfoDao getCheckFileInfoDao() {
        return checkFileInfoDao;
    }

    public CheckItemInfoDao getCheckItemInfoDao() {
        return checkItemInfoDao;
    }

}
